<?php 
include_once ('../../global.php');
$show = $_GET['show'];

?>

		
			
<?php
function toparcolor_mobile($score){
	if (!empty($score)){
		if ($score<='-2'){
            $color = 'mtwo';
        } else if ($score=='-1'){
            $color = 'mone';
        } else if ($score=='0'){
            $color = 'eng';
        } else if ($score=='1'){
            $color = 'pone';
        } else if ($score>='2'){
            $color = 'ptwo';
        } else {
            $color = 'eng';
        }
	} else {
		$color = 'eng';
	}
	return $color;
}


$start_hole = startHole($mt_id,$rd_id);
$holeScore   = getHoleScore($mt_id,$rd_id);        //当前洞和当前轮的topar
$score       = getScore($mt_id);                   //比赛成绩读取
for ($r=1;$r<=$rd_id;$r++){
    if (!empty($score['to_par'])){
        foreach ($score['to_par'] as $k => $v){
            $topar[$k] += $v[$r];
        }
    }
}
$summary_714 = playerSummary($mt_id,$rd_id,714);       //当前轮 U23
?>

			<div class="groupcode">
			<div style="background:#333333;color:#fff;font-weight:bold" onclick="scrollPosition('lU23')">U23</div>
			<div style="background:#1067ac;color:#fff;font-weight:bold" onclick="scrollPosition('lU19')">U19</div>
			<div style="background:#d90011;color:#fff;font-weight:bold" onclick="scrollPosition('lU13')">U13</div>
			<div style="background:#dd9a01;color:#fff;font-weight:bold" onclick="scrollPosition('lU10')">U10</div>
			</div>
			<table class="altrowstable scoringtable" style="margin-top:5px;">	
				<tbody id="lU23">
				<tr>
					<th width="8%" style="background-color:#333333;color:#fff">#</th>
					<th width="33%" style="background-color:#333333;color:#fff">Players-U23</th>
					<th width="9%" style="background-color:#333333;color:#fff">Thru</th>
					<th width="10%"  style="background-color:#333333;color:#fff">Score</th>
					<?php
					for($i=1;$i<=$maxRound;$i++){
                    	echo '<th width="10%" style="background-color:#333333;color:#fff">R'.$i.'</th>';
                    }	
					?>		
					<th width="10%"  style="background-color:#333333;color:#fff">Total</th>
					
				</tr>

<?php
$rank_714 = $summary_714['rank'];
$k=1;
$b=1;
if ($rank_714){
	foreach ($rank_714 as $i => $n){
		echo '<tr '.(($k%2==0)?'class="oddrowcolor"':'').'>
				<td >'.((empty($n))?'-':$n).'</td>
				<td align="left" style="text-align:left;" >
					<a href="detail.php?mt_id='.$mt_id.'&pl_id='.$i.'"><span style="color:#333333;font-style:italic">'.$players['playerCountry'][$i].'</span>&nbsp;&nbsp;'.$players['playerName'][$i].(($players['playerSex'][$i] == 0)?'&nbsp;<img src="./images/lady.png" width="10" height="10" style="padding-top:5px;padding-left:5px;" >':'').'</a>'.'
				</td>';
		if ($holeScore['thru'][$i]=='18'){
			if ($summary['checked'][$i]=='C'){
				echo '<td  style="color:#333333;font-weight:bolder;"> F </td>';
			} else {
				echo '<td  > F </td>';
			}
		} else {
			if ($holeScore['thru'][$i]!=""){
				echo '<td >'.$holeScore['thru'][$i].' '.(($start_hole[$i] >= 10) ? '*':'').'</td>';
			} else {
			  echo '<td >-</td>';
			}
		}
				echo '<td  ><div class="topar '.(($topar[$i]<0)?'undereven"':(($topar[$i]==0)?'even"':(($topar[$i]>0)?'pluseven"':'"'))).'>'.(($topar[$i]=='0') ? 'E' : (($topar[$i]=='') ? '' : (($topar[$i]>0) ? '+'.$topar[$i] : $topar[$i]))).'</div></td>';
		
		$totalscore = 0;
		for($r=1;$r<=$maxRound;$r++){
			if($r<=$rd_id){
			if ($holeScore['thru'][$i]=='18' || $r<$mt_round){
			  echo '<td><span '.(($score['to_par'][$i][$r]<0)?'style="color:#e50049;"':'').'>'.(($score['rd_score'][$i][$r])?$score['rd_score'][$i][$r]:'-').'</span></td>';
			}
			else{
			  echo '<td ><span '.(($score['to_par'][$i][$r]<0)?'style="color:#e50049;"':'').'>'.(($score['to_par'][$i][$r]=='0') ? 'E' : (($score['to_par'][$i][$r]=='') ? '' : (($score['to_par'][$i][$r]>0) ? '+'.$score['to_par'][$i][$r] : $score['to_par'][$i][$r]))).'</span></td>';
			}
			$totalscore +=$score['rd_score'][$i][$r];
			}
			else{
				echo '<td>-</td>';
			}
		}
		echo '<td >'.(($totalscore)?$totalscore:'-').'</td>';
		echo '</tr>';
		if ($k%10==0){
			
			
            echo '<tr>
                   <th width="8%" style="background-color:#333333;color:#fff">#</th>
					<th width="33%" style="background-color:#333333;color:#fff">Players-U23</th>
					<th width="9%" style="background-color:#333333;color:#fff">Thru</th>
					<th width="10%"  style="background-color:#333333;color:#fff">Score</th>';
            for($i=1;$i<=$maxRound;$i++){
            	echo '<th width="10%" style="background-color:#333333;color:#fff">R'.$i.'</th>';
            }
            echo '<th width="10%" style="background-color:#333333;color:#fff">Total</th>
                 
                </tr>';
				$b++;
		}	
		$k++;
	}
}
?>				
				
				</tbody>
			</table>
			
				
			<div class="groupcode">
			<div style="background:#333333;color:#fff;font-weight:bold" onclick="scrollPosition('lU23')">U23</div>
			<div style="background:#1067ac;color:#fff;font-weight:bold" onclick="scrollPosition('lU19')">U19</div>
			<div style="background:#d90011;color:#fff;font-weight:bold" onclick="scrollPosition('lU13')">U13</div>
			<div style="background:#dd9a01;color:#fff;font-weight:bold" onclick="scrollPosition('lU10')">U10</div>
			</div>
			<table class="altrowstable scoringtable" style="margin-top:5px;">	
				<tbody id="lU19">
				<tr>
					<th width="8%" style="background-color:#1067ac;color:#fff">#</th>
					<th width="33%" style="background-color:#1067ac;color:#fff">Players-U19</th>
					<th width="9%" style="background-color:#1067ac;color:#fff">Thru</th>
					<th width="10%"  style="background-color:#1067ac;color:#fff">Score</th>
					<?php
					for($i=1;$i<=$maxRound;$i++){
                    	echo '<th width="10%" style="background-color:#1067ac;color:#fff">R'.$i.'</th>';
                    }	
					?>		
					<th width="10%"  style="background-color:#1067ac;color:#fff">Total</th>
					
				</tr>

<?php
$summary_715 = playerSummary($mt_id,$rd_id,715);       //当前轮 U19
$rank_715 = $summary_715['rank'];
$k=1;
$b=1;
if (rank_715){
	foreach ($rank_715 as $i => $n){
		echo '<tr '.(($k%2==0)?'class="oddrowcolor"':'').'>
				<td >'.((empty($n))?'-':$n).'</td>
				<td align="left" style="text-align:left;" >
					<a href="detail.php?mt_id='.$mt_id.'&pl_id='.$i.'"><span style="color:#1067ac;font-style:italic">'.$players['playerCountry'][$i].'</span>&nbsp;&nbsp;'.$players['playerName'][$i].(($players['playerSex'][$i] == 0)?'&nbsp;<img src="./images/lady.png" width="10" height="10" style="padding-top:5px;padding-left:5px;" >':'').'</a>
				</td>';
				
		if ($holeScore['thru'][$i]=='18'){
			if ($summary['checked'][$i]=='C'){
				echo '<td  style="color:#1067ac;font-weight:bolder;"> F </td>';
			} else {
				echo '<td  > F </td>';
			}
		} else {
			if ($holeScore['thru'][$i]!=""){
				echo '<td >'.$holeScore['thru'][$i].' '.(($start_hole[$i] >= 10) ? '*':'').'</td>';
			} else {
			  echo '<td >-</td>';
			}
			
		}
		
		echo '<td  ><div class="topar '.(($topar[$i]<0)?'undereven"':(($topar[$i]==0)?'even"':(($topar[$i]>0)?'pluseven"':'"'))).'>'.(($topar[$i]=='0') ? 'E' : (($topar[$i]=='') ? '' : (($topar[$i]>0) ? '+'.$topar[$i] : $topar[$i]))).'</div></td>';
		$totalscore = 0;
		for($r=1;$r<=$maxRound;$r++){
			if($r<=$rd_id){
			if ($holeScore['thru'][$i]=='18'  || $r<$mt_round ){
			  echo '<td ><span '.(($score['to_par'][$i][$r]<0)?'style="color:#e50049;"':'').'>'.(($score['rd_score'][$i][$r])?$score['rd_score'][$i][$r]:'-').'</span></td>';
			}
			else{
			  echo '<td><span '.(($score['to_par'][$i][$r]<0)?'style="color:#e50049;"':'').'>'.(($score['to_par'][$i][$r]=='0') ? 'E' : (($score['to_par'][$i][$r]=='') ? '' : (($score['to_par'][$i][$r]>0) ? '+'.$score['to_par'][$i][$r] : $score['to_par'][$i][$r]))).'</span></td>';
			}
			$totalscore +=$score['rd_score'][$i][$r];
			}
			else{
				echo '<td>-</td>';
			}
		}
		
		echo '<td >'.(($totalscore)?$totalscore:'-').'</td>';
		echo '</tr>';
		if ($k%10==0){
			
			
            echo '<tr>
                   	<th width="8%" style="background-color:#1067ac;color:#fff">#</th>
					<th width="33%" style="background-color:#1067ac;color:#fff">Players-U19</th>
					<th width="9%" style="background-color:#1067ac;color:#fff">Thru</th>
					<th width="10%"  style="background-color:#1067ac;color:#fff">Score</th>';
            for($i=1;$i<=$maxRound;$i++){
            	echo '<th width="10%" style="background-color:#1067ac;color:#fff">R'.$i.'</th>';
            }
            echo '<th width="10%" style="background-color:#1067ac;color:#fff">Total</th>
                   
                </tr>';
				$b++;
		}	
		$k++;
	}
}
?>				
				
				</tbody>
			</table>
			
			
			<div class="groupcode">
			<div style="background:#333333;color:#fff;font-weight:bold" onclick="scrollPosition('lU23')">U23</div>
			<div style="background:#1067ac;color:#fff;font-weight:bold" onclick="scrollPosition('lU19')">U19</div>
			<div style="background:#d90011;color:#fff;font-weight:bold" onclick="scrollPosition('lU13')">U13</div>
			<div style="background:#dd9a01;color:#fff;font-weight:bold" onclick="scrollPosition('lU10')">U10</div>
			</div>
			<table class="altrowstable scoringtable" style="margin-top:5px;">	
				<tbody id="lU13">
				<tr>
					<th width="8%" style="background-color:#d90011;color:#fff">#</th>
					<th width="33%" style="background-color:#d90011;color:#fff">Players-U13</th>
					<th width="9%" style="background-color:#d90011;color:#fff">Thru</th>
					<th width="10%"  style="background-color:#d90011;color:#fff">Score</th>
					<?php
					for($i=1;$i<=$maxRound;$i++){
                    	echo '<th width="10%" style="background-color:#d90011;color:#fff">R'.$i.'</th>';
                    }	
					?>		
					<th width="10%"  style="background-color:#d90011;color:#fff">Total</th>
					
				</tr>

<?php
$summary_716 = playerSummary($mt_id,$rd_id,716);       //当前轮 U13
$rank_716 = $summary_716['rank'];
$k=1;
$b=1;
if ($rank_716){
	foreach ($rank_716 as $i => $n){
		echo '<tr '.(($k%2==0)?'class="oddrowcolor"':'').'>
				<td >'.((empty($n))?'-':$n).'</td>
				<td align="left" style="text-align:left;" >
					<a href="detail.php?mt_id='.$mt_id.'&pl_id='.$i.'"><span style="color:#1067ac;font-style:italic">'.$players['playerCountry'][$i].'</span>&nbsp;&nbsp;'.$players['playerName'][$i].(($players['playerSex'][$i] == 0)?'&nbsp;<img src="./images/lady.png" width="10" height="10" style="padding-top:5px;padding-left:5px;" >':'').'</a>
				</td>';
				
		if ($holeScore['thru'][$i]=='18'){
			if ($summary['checked'][$i]=='C'){
				echo '<td  style="color:#d90011;font-weight:bolder;"> F </td>';
			} else {
				echo '<td  > F </td>';
			}
		} else {
			if ($holeScore['thru'][$i]!=""){
				echo '<td >'.$holeScore['thru'][$i].' '.(($start_hole[$i] >= 10) ? '*':'').'</td>';
			} else {
			  echo '<td >-</td>';
			}
			
		}
		
		echo '<td  ><div class="topar '.(($topar[$i]<0)?'undereven"':(($topar[$i]==0)?'even"':(($topar[$i]>0)?'pluseven"':'"'))).'>'.(($topar[$i]=='0') ? 'E' : (($topar[$i]=='') ? '' : (($topar[$i]>0) ? '+'.$topar[$i] : $topar[$i]))).'</div></td>';
		$totalscore = 0;
		for($r=1;$r<=$maxRound;$r++){
			if($r<=$rd_id){
			if ($holeScore['thru'][$i]=='18'  || $r<$mt_round ){
			  echo '<td ><span '.(($score['to_par'][$i][$r]<0)?'style="color:#e50049;"':'').'>'.(($score['rd_score'][$i][$r])?$score['rd_score'][$i][$r]:'-').'</span></td>';
			}
			else{
			  echo '<td><span '.(($score['to_par'][$i][$r]<0)?'style="color:#e50049;"':'').'>'.(($score['to_par'][$i][$r]=='0') ? 'E' : (($score['to_par'][$i][$r]=='') ? '' : (($score['to_par'][$i][$r]>0) ? '+'.$score['to_par'][$i][$r] : $score['to_par'][$i][$r]))).'</span></td>';
			}
			$totalscore +=$score['rd_score'][$i][$r];
			}
			else{
				echo '<td>-</td>';
			}
		}
		
		echo '<td >'.(($totalscore)?$totalscore:'-').'</td>';
		echo '</tr>';
		if ($k%10==0){
			
			
            echo '<tr>
                   	<th width="8%" style="background-color:#d90011;color:#fff">#</th>
					<th width="33%" style="background-color:#d90011;color:#fff">Players-U13</th>
					<th width="9%" style="background-color:#d90011;color:#fff">Thru</th>
					<th width="10%"  style="background-color:#d90011;color:#fff">Score</th>';
            for($i=1;$i<=$maxRound;$i++){
            	echo '<th width="10%" style="background-color:#d90011;color:#fff">R'.$i.'</th>';
            }
            echo '<th width="10%" style="background-color:#d90011;color:#fff">Total</th>
                   
                </tr>';
				$b++;
		}	
		$k++;
	}
}
?>				
				
				</tbody>
			</table>
			
			<div class="groupcode">
			<div style="background:#333333;color:#fff;font-weight:bold" onclick="scrollPosition('lU23')">U23</div>
			<div style="background:#1067ac;color:#fff;font-weight:bold" onclick="scrollPosition('lU19')">U19</div>
			<div style="background:#d90011;color:#fff;font-weight:bold" onclick="scrollPosition('lU13')">U13</div>
			<div style="background:#dd9a01;color:#fff;font-weight:bold" onclick="scrollPosition('lU10')">U10</div>
			</div>
			<table class="altrowstable scoringtable" style="margin-top:5px;">	
				<tbody id="lU10">
				<tr>
					<th width="8%" style="background-color:#dd9a01;color:#fff">#</th>
					<th width="33%" style="background-color:#dd9a01;color:#fff">Players-U10</th>
					<th width="9%" style="background-color:#dd9a01;color:#fff">Thru</th>
					<th width="10%"  style="background-color:#dd9a01;color:#fff">Score</th>
					<?php
					for($i=1;$i<=$maxRound;$i++){
                    	echo '<th width="10%" style="background-color:#dd9a01;color:#fff">R'.$i.'</th>';
                    }	
					?>		
					<th width="10%"  style="background-color:#dd9a01;color:#fff">Total</th>
					
				</tr>

<?php
$summary_717 = playerSummary($mt_id,$rd_id,717);       //当前轮 U10
$rank_717 = $summary_717['rank'];
$k=1;
$b=1;
if ($rank_717){
	foreach ($rank_717 as $i => $n){
		echo '<tr '.(($k%2==0)?'class="oddrowcolor"':'').'>
				<td >'.((empty($n))?'-':$n).'</td>
				<td align="left" style="text-align:left;" >
					<a href="detail.php?mt_id='.$mt_id.'&pl_id='.$i.'"><span style="color:#1067ac;font-style:italic">'.$players['playerCountry'][$i].'</span>&nbsp;&nbsp;'.$players['playerName'][$i].(($players['playerSex'][$i] == 0)?'&nbsp;<img src="./images/lady.png" width="10" height="10" style="padding-top:5px;padding-left:5px;" >':'').'</a>
				</td>';
				
		if ($holeScore['thru'][$i]=='18'){
			if ($summary['checked'][$i]=='C'){
				echo '<td  style="color:#dd9a01;font-weight:bolder;"> F </td>';
			} else {
				echo '<td  > F </td>';
			}
		} else {
			if ($holeScore['thru'][$i]!=""){
				echo '<td >'.$holeScore['thru'][$i].' '.(($start_hole[$i] >= 10) ? '*':'').'</td>';
			} else {
			  echo '<td >-</td>';
			}
			
		}
		
		echo '<td  ><div class="topar '.(($topar[$i]<0)?'undereven"':(($topar[$i]==0)?'even"':(($topar[$i]>0)?'pluseven"':'"'))).'>'.(($topar[$i]=='0') ? 'E' : (($topar[$i]=='') ? '' : (($topar[$i]>0) ? '+'.$topar[$i] : $topar[$i]))).'</div></td>';
		$totalscore = 0;
		for($r=1;$r<=$maxRound;$r++){
			if($r<=$rd_id){
			if ($holeScore['thru'][$i]=='18'  || $r<$mt_round ){
			  echo '<td ><span '.(($score['to_par'][$i][$r]<0)?'style="color:#e50049;"':'').'>'.(($score['rd_score'][$i][$r])?$score['rd_score'][$i][$r]:'-').'</span></td>';
			}
			else{
			  echo '<td><span '.(($score['to_par'][$i][$r]<0)?'style="color:#e50049;"':'').'>'.(($score['to_par'][$i][$r]=='0') ? 'E' : (($score['to_par'][$i][$r]=='') ? '' : (($score['to_par'][$i][$r]>0) ? '+'.$score['to_par'][$i][$r] : $score['to_par'][$i][$r]))).'</span></td>';
			}
			$totalscore +=$score['rd_score'][$i][$r];
			}
			else{
				echo '<td>-</td>';
			}
		}
		
		echo '<td >'.(($totalscore)?$totalscore:'-').'</td>';
		echo '</tr>';
		if ($k%10==0){
			
			
            echo '<tr>
                   	<th width="8%" style="background-color:#dd9a01;color:#fff">#</th>
					<th width="33%" style="background-color:#dd9a01;color:#fff">Players-U10</th>
					<th width="9%" style="background-color:#dd9a01;color:#fff">Thru</th>
					<th width="10%"  style="background-color:#dd9a01;color:#fff">Score</th>';
            for($i=1;$i<=$maxRound;$i++){
            	echo '<th width="10%" style="background-color:#dd9a01;color:#fff">R'.$i.'</th>';
            }
            echo '<th width="10%" style="background-color:#dd9a01;color:#fff">Total</th>
                   
                </tr>';
				$b++;
		}	
		$k++;
	}
}
?>				
				
				</tbody>
			</table>

<--split-->


			<div class="groupcode" id="conU23">
				<div style="background:#333333;color:#fff;font-weight:bold" onclick="scrollPosition('conU23')">U23</div>
				<div style="background:#1067ac;color:#fff;font-weight:bold" onclick="scrollPosition('conU19')">U19</div>
				<div style="background:#d90011;color:#fff;font-weight:bold" onclick="scrollPosition('conU13')">U13</div>
				<div style="background:#dd9a01;color:#fff;font-weight:bold" onclick="scrollPosition('conU10')">U10</div>
		
			</div>

			<table class="altrowstable scoringtable" id="tbscoring0">
				<thead>
					<tr id="trHeader0">
						<th width="2%" rowspan="2" style="background-color:#333333;color:#fff"> Pos </th>
						<th width="20%" rowspan="2" style="background-color:#333333;color:#fff"> Players-U23 </th>
						<th width="3%" rowspan="2" style="background-color:#333333;color:#fff"> After </th>
						<th width="4%" rowspan="2" style="background-color:#333333;color:#fff"> TP </th>
						<th width="4%" rowspan="2" style="background-color:#333333;color:#fff"> TD </th>
						<th width="2%" style="background-color:#333333;color:#fff">1</th>
						<th width="2%" style="background-color:#333333;color:#fff">2</th>
						<th width="2%" style="background-color:#333333;color:#fff">3</th>
						<th width="2%" style="background-color:#333333;color:#fff">4</th>
						<th width="2%" style="background-color:#333333;color:#fff">5</th>
						<th width="2%" style="background-color:#333333;color:#fff">6</th>
						<th width="2%" style="background-color:#333333;color:#fff">7</th>
						<th width="2%" style="background-color:#333333;color:#fff">8</th>
						<th width="2%" style="background-color:#333333;color:#fff">9</th>
						<th width="3%" style="background-color:#333333;color:#fff">OUT</th>
						<th width="2%" style="background-color:#333333;color:#fff">10</th>
						<th width="2%" style="background-color:#333333;color:#fff">11</th>
						<th width="2%" style="background-color:#333333;color:#fff">12</th>
						<th width="2%" style="background-color:#333333;color:#fff">13</th>
						<th width="2%" style="background-color:#333333;color:#fff">14</th>
						<th width="2%" style="background-color:#333333;color:#fff">15</th>
						<th width="2%" style="background-color:#333333;color:#fff">16</th>
						<th width="2%" style="background-color:#333333;color:#fff">17</th>
						<th width="2%" style="background-color:#333333;color:#fff">18</th>
						<th width="3%" style="background-color:#333333;color:#fff">IN</th>
						<?php
						for($i=1;$i<=$maxRound;$i++){
							echo '<th width="3%" rowspan="2" style="background-color:#333333;color:#fff">R'.$i.'</th>';
						}
						?>
						<th width="3%" rowspan="2" style="background-color:#333333;color:#fff"> Total </th>
					</tr>
					<tr>
						<?php
                            $out_total = $in_total = 0;
                            for ($i=1;$i<10;$i++){
                                echo '<th class="clspar" style="background-color:#333333;color:#fff">'.$pars["par"][($i-1)].'</th>';
                                $out_total += $pars["par"][($i-1)];
                            }
                            echo '<th class="clspar" style="background-color:#333333;color:#fff">'.$out_total.'</th>';

                            for ($i=10;$i<19;$i++){
                                echo '<th class="clspar" style="background-color:#333333;color:#fff">'.$pars["par"][($i-1)].'</th>';
                                $in_total += $pars["par"][($i-1)];
                            }
                            echo '<th class="clspar" style="background-color:#333333;color:#fff">'.$in_total.'</th>';
                        ?>
					</tr>
					</thead>
					<tbody>
<?php
$k=1;
if ($rank_714){
foreach ($rank_714 as $i => $n){
	echo '<tr '.(($k%2==0)?'class="oddrowcolor"':'').'>
			<td>'.((empty($n))?'-':$n).'</td>
			<td style="text-align:left;"><span style="color:#333333;font-style:italic">'.$players['playerCountry'][$i].'</span>&nbsp;&nbsp;'.$players['playerName'][$i].(($players['playerSex'][$i] == 0)?'&nbsp;<img src="./images/lady.png" width="10" height="10" style="padding-top:5px;padding-left:5px;" >':'').'</td>';
	//完成洞数
    if ($holeScore['thru'][$i]=='18'){
        if ($summary['checked'][$i]=='C'){
            echo '<td> F </td>';
        } else {
            echo '<td> F </td>';
        }
    } else {
        if ($holeScore['thru'][$i]!=""){
            echo '<td>'.$holeScore['thru'][$i].' '.(($start_hole[$i] == 10) ? '*':'').'</td>';
        } else {
          echo '<td></td>';
        }
    }
   echo '<td ><div class="topar '.(($topar[$i]<0)?'undereven"':(($topar[$i]==0)?'even"':(($topar[$i]>0)?'pluseven"':'"'))).'>'.(($topar[$i]=='0') ? 'E' : (($topar[$i]=='') ? '' : (($topar[$i]>0) ? '+'.$topar[$i] : $topar[$i]))).'</div></td>';
	echo	  '<td '.(($score['to_par'][$i][$rd_id]<0)?'style="color:#e50049;"':'').'>'.(($score['to_par'][$i][$rd_id]=='0') ? 'E' : (($score['to_par'][$i][$rd_id]=='') ? '' : (($score['to_par'][$i][$rd_id]>0) ? '+'.$score['to_par'][$i][$rd_id] : $score['to_par'][$i][$rd_id]))).'</td>';
	//18洞成绩
    $out_score = $in_score = 0;
    for ($h=1;$h<10;$h++){
        echo '<td class="'.toparcolor_mobile($holeScore['topar'][$i][$h]).'">'.$holeScore['score'][$i][$h].'</td>';
        $out_score += $holeScore['score'][$i][$h];
    }
    echo '<td class="inout">'.$out_score.'</td>';
    for ($h=10;$h<19;$h++){
        echo '<td class="'.toparcolor_mobile($holeScore['topar'][$i][$h]).'">'.$holeScore['score'][$i][$h].'</td>';
        $in_score += $holeScore['score'][$i][$h];
    }
    echo '<td class="inout">'.$in_score.'</td>';

    //R1-R4成绩
    $totalscore = '';
    for($r=1;$r<=$maxRound;$r++){
        if ($r<=$rd_id){
            echo '<td  style="background-color:#333333;color:#fff">'.$score['rd_score'][$i][$r].'</td>';
            $totalscore += $score['rd_score'][$i][$r];
        } else {
            echo '<td style="background-color:#333333;color:#fff">-</td>';
        }
    }
    echo '<td class="inout">'.$totalscore.'</td>';
	echo '</tr>';
	$k++;
	}
}
?>
			
				</tbody>
			</table>

			<div class="groupcode" id="conU19">
				<div style="background:#333333;color:#fff;font-weight:bold" onclick="scrollPosition('conU23')">U23</div>
				<div style="background:#1067ac;color:#fff;font-weight:bold" onclick="scrollPosition('conU19')">U19</div>
				<div style="background:#d90011;color:#fff;font-weight:bold" onclick="scrollPosition('conU13')">U13</div>
				<div style="background:#dd9a01;color:#fff;font-weight:bold" onclick="scrollPosition('conU10')">U10</div>
			</div>

			<table class="altrowstable scoringtable" id="tbscoring1">
				<thead>
					<tr id="trHeader1">
						<th width="2%" rowspan="2" style="background-color:#1067ac;color:#fff"> Pos </th>
						<th width="20%" rowspan="2" style="background-color:#1067ac;color:#fff"> Players-U19 </th>
						<th width="3%" rowspan="2" style="background-color:#1067ac;color:#fff"> After </th>
						<th width="4%" rowspan="2" style="background-color:#1067ac;color:#fff"> TP </th>
						<th width="4%" rowspan="2" style="background-color:#1067ac;color:#fff"> TD </th>
						<th width="2%" style="background-color:#1067ac;color:#fff">1</th>
						<th width="2%" style="background-color:#1067ac;color:#fff">2</th>
						<th width="2%" style="background-color:#1067ac;color:#fff">3</th>
						<th width="2%" style="background-color:#1067ac;color:#fff">4</th>
						<th width="2%" style="background-color:#1067ac;color:#fff">5</th>
						<th width="2%" style="background-color:#1067ac;color:#fff">6</th>
						<th width="2%" style="background-color:#1067ac;color:#fff">7</th>
						<th width="2%" style="background-color:#1067ac;color:#fff">8</th>
						<th width="2%" style="background-color:#1067ac;color:#fff">9</th>
						<th width="3%" style="background-color:#1067ac;color:#fff">OUT</th>
						<th width="2%" style="background-color:#1067ac;color:#fff">10</th>
						<th width="2%" style="background-color:#1067ac;color:#fff">11</th>
						<th width="2%" style="background-color:#1067ac;color:#fff">12</th>
						<th width="2%" style="background-color:#1067ac;color:#fff">13</th>
						<th width="2%" style="background-color:#1067ac;color:#fff">14</th>
						<th width="2%" style="background-color:#1067ac;color:#fff">15</th>
						<th width="2%" style="background-color:#1067ac;color:#fff">16</th>
						<th width="2%" style="background-color:#1067ac;color:#fff">17</th>
						<th width="2%" style="background-color:#1067ac;color:#fff">18</th>
						<th width="3%" style="background-color:#1067ac;color:#fff">IN</th>
						<?php
						for($i=1;$i<=$maxRound;$i++){
							echo '<th width="3%" rowspan="2" style="background-color:#1067ac;color:#fff">R'.$i.'</th>';
						}
						?>
						<th width="3%" rowspan="2" style="background-color:#1067ac;color:#fff"> Total </th>
					</tr>
					<tr>
						<?php
                            $out_total = $in_total = 0;
                            for ($i=1;$i<10;$i++){
                                echo '<th class="clspar" style="background-color:#1067ac;color:#fff">'.$pars["par"][($i-1)].'</th>';
                                $out_total += $pars["par"][($i-1)];
                            }
                            echo '<th class="clspar" style="background-color:#1067ac;color:#fff">'.$out_total.'</th>';

                            for ($i=10;$i<19;$i++){
                                echo '<th class="clspar" style="background-color:#1067ac;color:#fff">'.$pars["par"][($i-1)].'</th>';
                                $in_total += $pars["par"][($i-1)];
                            }
                            echo '<th class="clspar" style="background-color:#1067ac;color:#fff">'.$in_total.'</th>';
                        ?>
					</tr>
					</thead>
					<tbody>
<?php
$k=1;
if ($rank_715){
foreach ($rank_715 as $i => $n){
	echo '<tr '.(($k%2==0)?'class="oddrowcolor"':'').'>
			<td>'.((empty($n))?'-':$n).'</td>
			<td style="text-align:left;"><span style="color:#1067ac;font-style:italic">'.$players['playerCountry'][$i].'</span>&nbsp;&nbsp;'.$players['playerName'][$i].(($players['playerSex'][$i] == 0)?'&nbsp;<img src="./images/lady.png" width="10" height="10" style="padding-top:5px;padding-left:5px;" >':'').'</td>';
	//完成洞数
    if ($holeScore['thru'][$i]=='18'){
        if ($summary['checked'][$i]=='C'){
            echo '<td> F </td>';
        } else {
            echo '<td> F </td>';
        }
    } else {
        if ($holeScore['thru'][$i]!=""){
            echo '<td>'.$holeScore['thru'][$i].' '.(($start_hole[$i] == 10) ? '*':'').'</td>';
        } else {
          echo '<td></td>';
        }
    }
   echo '<td ><div class="topar '.(($topar[$i]<0)?'undereven"':(($topar[$i]==0)?'even"':(($topar[$i]>0)?'pluseven"':'"'))).'>'.(($topar[$i]=='0') ? 'E' : (($topar[$i]=='') ? '' : (($topar[$i]>0) ? '+'.$topar[$i] : $topar[$i]))).'</div></td>';
	echo	  '<td '.(($score['to_par'][$i][$rd_id]<0)?'style="color:#e50049;"':'').'>'.(($score['to_par'][$i][$rd_id]=='0') ? 'E' : (($score['to_par'][$i][$rd_id]=='') ? '' : (($score['to_par'][$i][$rd_id]>0) ? '+'.$score['to_par'][$i][$rd_id] : $score['to_par'][$i][$rd_id]))).'</td>';
	//18洞成绩
    $out_score = $in_score = 0;
    for ($h=1;$h<10;$h++){
        echo '<td class="'.toparcolor_mobile($holeScore['topar'][$i][$h]).'">'.$holeScore['score'][$i][$h].'</td>';
        $out_score += $holeScore['score'][$i][$h];
    }
    echo '<td class="inout">'.$out_score.'</td>';
    for ($h=10;$h<19;$h++){
        echo '<td class="'.toparcolor_mobile($holeScore['topar'][$i][$h]).'">'.$holeScore['score'][$i][$h].'</td>';
        $in_score += $holeScore['score'][$i][$h];
    }
    echo '<td class="inout">'.$in_score.'</td>';

    //R1-R4成绩
    $totalscore = '';
    for($r=1;$r<=$maxRound;$r++){
        if ($r<=$rd_id){
            echo '<td  style="background-color:#1067ac;color:#fff">'.$score['rd_score'][$i][$r].'</td>';
            $totalscore += $score['rd_score'][$i][$r];
        } else {
            echo '<td style="background-color:#1067ac;color:#fff">-</td>';
        }
    }
    echo '<td class="inout">'.$totalscore.'</td>';
	echo '</tr>';
	$k++;
	}
}
?>
				
				</tbody>
			</table>
			
			<div class="groupcode" id="conU13">
				<div style="background:#333333;color:#fff;font-weight:bold" onclick="scrollPosition('conU23')">U23</div>
				<div style="background:#1067ac;color:#fff;font-weight:bold" onclick="scrollPosition('conU19')">U19</div>
				<div style="background:#d90011;color:#fff;font-weight:bold" onclick="scrollPosition('conU13')">U13</div>
				<div style="background:#dd9a01;color:#fff;font-weight:bold" onclick="scrollPosition('conU10')">U10</div>
			</div>

			<table class="altrowstable scoringtable" id="tbscoring2">
				<thead>
					<tr id="trHeader2">
						<th width="2%" rowspan="2" style="background-color:#d90011;color:#fff"> Pos </th>
						<th width="20%" rowspan="2" style="background-color:#d90011;color:#fff"> Players-U13 </th>
						<th width="3%" rowspan="2" style="background-color:#d90011;color:#fff"> After </th>
						<th width="4%" rowspan="2" style="background-color:#d90011;color:#fff"> TP </th>
						<th width="4%" rowspan="2" style="background-color:#d90011;color:#fff"> TD </th>
						<th width="2%" style="background-color:#d90011;color:#fff">1</th>
						<th width="2%" style="background-color:#d90011;color:#fff">2</th>
						<th width="2%" style="background-color:#d90011;color:#fff">3</th>
						<th width="2%" style="background-color:#d90011;color:#fff">4</th>
						<th width="2%" style="background-color:#d90011;color:#fff">5</th>
						<th width="2%" style="background-color:#d90011;color:#fff">6</th>
						<th width="2%" style="background-color:#d90011;color:#fff">7</th>
						<th width="2%" style="background-color:#d90011;color:#fff">8</th>
						<th width="2%" style="background-color:#d90011;color:#fff">9</th>
						<th width="3%" style="background-color:#d90011;color:#fff">OUT</th>
						<th width="2%" style="background-color:#d90011;color:#fff">10</th>
						<th width="2%" style="background-color:#d90011;color:#fff">11</th>
						<th width="2%" style="background-color:#d90011;color:#fff">12</th>
						<th width="2%" style="background-color:#d90011;color:#fff">13</th>
						<th width="2%" style="background-color:#d90011;color:#fff">14</th>
						<th width="2%" style="background-color:#d90011;color:#fff">15</th>
						<th width="2%" style="background-color:#d90011;color:#fff">16</th>
						<th width="2%" style="background-color:#d90011;color:#fff">17</th>
						<th width="2%" style="background-color:#d90011;color:#fff">18</th>
						<th width="3%" style="background-color:#d90011;color:#fff">IN</th>
						<?php
						for($i=1;$i<=$maxRound;$i++){
							echo '<th width="3%" rowspan="2" style="background-color:#d90011;color:#fff">R'.$i.'</th>';
						}
						?>
						<th width="3%" rowspan="2" style="background-color:#d90011;color:#fff"> Total </th>
					</tr>
					<tr>
						<?php
                            $out_total = $in_total = 0;
                            for ($i=1;$i<10;$i++){
                                echo '<th class="clspar" style="background-color:#d90011;color:#fff">'.$pars["par"][($i-1)].'</th>';
                                $out_total += $pars["par"][($i-1)];
                            }
                            echo '<th class="clspar" style="background-color:#d90011;color:#fff">'.$out_total.'</th>';

                            for ($i=10;$i<19;$i++){
                                echo '<th class="clspar" style="background-color:#d90011;color:#fff">'.$pars["par"][($i-1)].'</th>';
                                $in_total += $pars["par"][($i-1)];
                            }
                            echo '<th class="clspar" style="background-color:#d90011;color:#fff">'.$in_total.'</th>';
                        ?>
					</tr>
					</thead>
					<tbody>
<?php
$k=1;
if ($rank_716){
foreach ($rank_716 as $i => $n){
	echo '<tr '.(($k%2==0)?'class="oddrowcolor"':'').'>
			<td>'.((empty($n))?'-':$n).'</td>
			<td style="text-align:left;"><span style="color:#1067ac;font-style:italic">'.$players['playerCountry'][$i].'</span>&nbsp;&nbsp;'.$players['playerName'][$i].(($players['playerSex'][$i] == 0)?'&nbsp;<img src="./images/lady.png" width="10" height="10" style="padding-top:5px;padding-left:5px;" >':'').'</td>';
	//完成洞数
    if ($holeScore['thru'][$i]=='18'){
        if ($summary['checked'][$i]=='C'){
            echo '<td> F </td>';
        } else {
            echo '<td> F </td>';
        }
    } else {
        if ($holeScore['thru'][$i]!=""){
            echo '<td>'.$holeScore['thru'][$i].' '.(($start_hole[$i] == 10) ? '*':'').'</td>';
        } else {
          echo '<td></td>';
        }
    }
   echo '<td ><div class="topar '.(($topar[$i]<0)?'undereven"':(($topar[$i]==0)?'even"':(($topar[$i]>0)?'pluseven"':'"'))).'>'.(($topar[$i]=='0') ? 'E' : (($topar[$i]=='') ? '' : (($topar[$i]>0) ? '+'.$topar[$i] : $topar[$i]))).'</div></td>';
	echo	  '<td '.(($score['to_par'][$i][$rd_id]<0)?'style="color:#e50049;"':'').'>'.(($score['to_par'][$i][$rd_id]=='0') ? 'E' : (($score['to_par'][$i][$rd_id]=='') ? '' : (($score['to_par'][$i][$rd_id]>0) ? '+'.$score['to_par'][$i][$rd_id] : $score['to_par'][$i][$rd_id]))).'</td>';
	//18洞成绩
    $out_score = $in_score = 0;
    for ($h=1;$h<10;$h++){
        echo '<td class="'.toparcolor_mobile($holeScore['topar'][$i][$h]).'">'.$holeScore['score'][$i][$h].'</td>';
        $out_score += $holeScore['score'][$i][$h];
    }
    echo '<td class="inout">'.$out_score.'</td>';
    for ($h=10;$h<19;$h++){
        echo '<td class="'.toparcolor_mobile($holeScore['topar'][$i][$h]).'">'.$holeScore['score'][$i][$h].'</td>';
        $in_score += $holeScore['score'][$i][$h];
    }
    echo '<td class="inout">'.$in_score.'</td>';

    //R1-R4成绩
    $totalscore = '';
    for($r=1;$r<=$maxRound;$r++){
        if ($r<=$rd_id){
            echo '<td  style="background-color:#d90011;color:#fff">'.$score['rd_score'][$i][$r].'</td>';
            $totalscore += $score['rd_score'][$i][$r];
        } else {
            echo '<td style="background-color:#d90011;color:#fff">-</td>';
        }
    }
    echo '<td class="inout">'.$totalscore.'</td>';
	echo '</tr>';
	$k++;
	}
}
?>
				
				</tbody>
			</table>
			
			
				<div class="groupcode" id="conU10">
				<div style="background:#333333;color:#fff;font-weight:bold" onclick="scrollPosition('conU23')">U23</div>
				<div style="background:#1067ac;color:#fff;font-weight:bold" onclick="scrollPosition('conU19')">U19</div>
				<div style="background:#d90011;color:#fff;font-weight:bold" onclick="scrollPosition('conU13')">U13</div>
				<div style="background:#dd9a01;color:#fff;font-weight:bold" onclick="scrollPosition('conU10')">U10</div>
			</div>

			<table class="altrowstable scoringtable" id="tbscoring3">
				<thead>
					<tr id="trHeader3">
						<th width="2%" rowspan="2" style="background-color:#dd9a01;color:#fff"> Pos </th>
						<th width="20%" rowspan="2" style="background-color:#dd9a01;color:#fff"> Players-U10 </th>
						<th width="3%" rowspan="2" style="background-color:#dd9a01;color:#fff"> After </th>
						<th width="4%" rowspan="2" style="background-color:#dd9a01;color:#fff"> TP </th>
						<th width="4%" rowspan="2" style="background-color:#dd9a01;color:#fff"> TD </th>
						<th width="2%" style="background-color:#dd9a01;color:#fff">1</th>
						<th width="2%" style="background-color:#dd9a01;color:#fff">2</th>
						<th width="2%" style="background-color:#dd9a01;color:#fff">3</th>
						<th width="2%" style="background-color:#dd9a01;color:#fff">4</th>
						<th width="2%" style="background-color:#dd9a01;color:#fff">5</th>
						<th width="2%" style="background-color:#dd9a01;color:#fff">6</th>
						<th width="2%" style="background-color:#dd9a01;color:#fff">7</th>
						<th width="2%" style="background-color:#dd9a01;color:#fff">8</th>
						<th width="2%" style="background-color:#dd9a01;color:#fff">9</th>
						<th width="3%" style="background-color:#dd9a01;color:#fff">OUT</th>
						<th width="2%" style="background-color:#dd9a01;color:#fff">10</th>
						<th width="2%" style="background-color:#dd9a01;color:#fff">11</th>
						<th width="2%" style="background-color:#dd9a01;color:#fff">12</th>
						<th width="2%" style="background-color:#dd9a01;color:#fff">13</th>
						<th width="2%" style="background-color:#dd9a01;color:#fff">14</th>
						<th width="2%" style="background-color:#dd9a01;color:#fff">15</th>
						<th width="2%" style="background-color:#dd9a01;color:#fff">16</th>
						<th width="2%" style="background-color:#dd9a01;color:#fff">17</th>
						<th width="2%" style="background-color:#dd9a01;color:#fff">18</th>
						<th width="3%" style="background-color:#dd9a01;color:#fff">IN</th>
						<?php
						for($i=1;$i<=$maxRound;$i++){
							echo '<th width="3%" rowspan="2" style="background-color:#dd9a01;color:#fff">R'.$i.'</th>';
						}
						?>
						<th width="3%" rowspan="2" style="background-color:#dd9a01;color:#fff"> Total </th>
					</tr>
					<tr>
						<?php
                            $out_total = $in_total = 0;
                            for ($i=1;$i<10;$i++){
                                echo '<th class="clspar" style="background-color:#dd9a01;color:#fff">'.$pars["par"][($i-1)].'</th>';
                                $out_total += $pars["par"][($i-1)];
                            }
                            echo '<th class="clspar" style="background-color:#dd9a01;color:#fff">'.$out_total.'</th>';

                            for ($i=10;$i<19;$i++){
                                echo '<th class="clspar" style="background-color:#dd9a01;color:#fff">'.$pars["par"][($i-1)].'</th>';
                                $in_total += $pars["par"][($i-1)];
                            }
                            echo '<th class="clspar" style="background-color:#dd9a01;color:#fff">'.$in_total.'</th>';
                        ?>
					</tr>
					</thead>
					<tbody>
<?php
$k=1;
if ($rank_717){
foreach ($rank_717 as $i => $n){
	echo '<tr '.(($k%2==0)?'class="oddrowcolor"':'').'>
			<td>'.((empty($n))?'-':$n).'</td>
			<td style="text-align:left;"><span style="color:#1067ac;font-style:italic">'.$players['playerCountry'][$i].'</span>&nbsp;&nbsp;'.$players['playerName'][$i].(($players['playerSex'][$i] == 0)?'&nbsp;<img src="./images/lady.png" width="10" height="10" style="padding-top:5px;padding-left:5px;" >':'').'</td>';
	//完成洞数
    if ($holeScore['thru'][$i]=='18'){
        if ($summary['checked'][$i]=='C'){
            echo '<td> F </td>';
        } else {
            echo '<td> F </td>';
        }
    } else {
        if ($holeScore['thru'][$i]!=""){
            echo '<td>'.$holeScore['thru'][$i].' '.(($start_hole[$i] == 10) ? '*':'').'</td>';
        } else {
          echo '<td></td>';
        }
    }
   echo '<td ><div class="topar '.(($topar[$i]<0)?'undereven"':(($topar[$i]==0)?'even"':(($topar[$i]>0)?'pluseven"':'"'))).'>'.(($topar[$i]=='0') ? 'E' : (($topar[$i]=='') ? '' : (($topar[$i]>0) ? '+'.$topar[$i] : $topar[$i]))).'</div></td>';
	echo	  '<td '.(($score['to_par'][$i][$rd_id]<0)?'style="color:#e50049;"':'').'>'.(($score['to_par'][$i][$rd_id]=='0') ? 'E' : (($score['to_par'][$i][$rd_id]=='') ? '' : (($score['to_par'][$i][$rd_id]>0) ? '+'.$score['to_par'][$i][$rd_id] : $score['to_par'][$i][$rd_id]))).'</td>';
	//18洞成绩
    $out_score = $in_score = 0;
    for ($h=1;$h<10;$h++){
        echo '<td class="'.toparcolor_mobile($holeScore['topar'][$i][$h]).'">'.$holeScore['score'][$i][$h].'</td>';
        $out_score += $holeScore['score'][$i][$h];
    }
    echo '<td class="inout">'.$out_score.'</td>';
    for ($h=10;$h<19;$h++){
        echo '<td class="'.toparcolor_mobile($holeScore['topar'][$i][$h]).'">'.$holeScore['score'][$i][$h].'</td>';
        $in_score += $holeScore['score'][$i][$h];
    }
    echo '<td class="inout">'.$in_score.'</td>';

    //R1-R4成绩
    $totalscore = '';
    for($r=1;$r<=$maxRound;$r++){
        if ($r<=$rd_id){
            echo '<td  style="background-color:#dd9a01;color:#fff">'.$score['rd_score'][$i][$r].'</td>';
            $totalscore += $score['rd_score'][$i][$r];
        } else {
            echo '<td style="background-color:#dd9a01;color:#fff">-</td>';
        }
    }
    echo '<td class="inout">'.$totalscore.'</td>';
	echo '</tr>';
	$k++;
	}
}
?>
				
				</tbody>
			</table>
			
			
			


		



